import api_login from '@/api/login'
import { getToken } from '@/utils/auth'

const user = {
  namespaced: true,
  state: {
    token: getToken(),
    userInfo: {}
  },

  mutations: {
    SET_INFO: (state, userInfo) => {
      state.userInfo = userInfo
    }
  },

  actions: {
    GetCityList({ commit }) {
      api_login.countryList().then(res => {
        uni.setStorageSync("cityList", res.arealist[0].children)
      })
    }
  }
}

export default user
